﻿package mortal.game.view.mainUI.Navbar
{
    import flash.display.*;
    import flash.geom.*;
    import flash.utils.*;

    public class NavbarShaker extends Object
    {
        private var _originalPoints:Dictionary;
        private var _pool:Array;
        public static var instance:NavbarShaker = new NavbarShaker;

        public function NavbarShaker()
        {
            this._originalPoints = new Dictionary();
            this._pool = [];
            return;
        }// end function

        public function shake(param1:DisplayObject, param2:Number = -1) : void
        {
            var _loc_3:* = this._originalPoints[param1] as Point;
            if (_loc_3 == null)
            {
                _loc_3 = new Point(param1.x, param1.y);
                this._originalPoints[param1] = _loc_3;
            }
            var _loc_4:* = this.outPool();
            _loc_4.shake(param1, _loc_3.x, _loc_3.y, param2);
            return;
        }// end function

        public function inPool(param1:NavbarShakerItem) : void
        {
            this._pool.push(param1);
            return;
        }// end function

        public function outPool() : NavbarShakerItem
        {
            var _loc_1:* = this._pool.shift();
            if (_loc_1 == null)
            {
                _loc_1 = new NavbarShakerItem();
            }
            return _loc_1;
        }// end function

    }
}
